﻿using System;
using System.Data;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using HiauPdm.Bll;
using HiauPdm.Web;

namespace HiauPdm.Web
{
    public partial class GysXzLeft : PageBase
    {
        protected override bool IsAccess()
        {
            return true;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                LblTitle.Text = "供应商类别";
                TreeNode tn = new TreeNode("供应商类别", "0");
                tn.SelectAction = TreeNodeSelectAction.None;
                DataSet dsGyslb = BJcSj.GetGysLb();
                if (dsGyslb != null && dsGyslb.Tables[0].Rows.Count > 0)
                {
                    int idx = 1;
                    foreach (DataRow dr in dsGyslb.Tables[0].Rows)
                    {
                        TreeNode tnChild = new TreeNode(string.Format("[{0}]{1}", idx++, dr["类别"]), (string)dr["类别"]);
                        tnChild.ToolTip = tnChild.Text;
                        tnChild.NavigateUrl = "javascript:GotoUrl('" + dr["类别"].ToString() + "');";
                        tn.ChildNodes.Add(tnChild);
                    }
                }
                TreeGyslb.Nodes.Add(tn);
                TreeGyslb.ExpandDepth = 1;
            }
        }
    }
}